3.9.24 \(\int \frac {(-a-b x)^{-n} (a+b x)^n}{x} \, dx\) [824]

Optimal. Leaf size=22 \[ (-a-b x)^{-n} (a+b x)^n \log (x) \]

[Out]

(b*x+a)^n*ln(x)/((-b*x-a)^n)

________________________________________________________________________________________

Rubi [A]
time = 0.00, antiderivative size = 22, normalized size of antiderivative = 1.00, number of steps used = 2, number of rules used = 2, integrand size = 23, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.087, Rules used = {23, 29} \begin {gather*} \log (x) (-a-b x)^{-n} (a+b x)^n \end {gather*}

Antiderivative was successfully verified.

[In]

Int[(a + b*x)^n/(x*(-a - b*x)^n),x]

[Out]

((a + b*x)^n*Log[x])/(-a - b*x)^n

Rule 23

Int[(u_.)*((a_) + (b_.)*(v_))^(m_)*((c_) + (d_.)*(v_))^(n_), x_Symbol] :> Dist[(a + b*v)^m/(c + d*v)^m, Int[u*
(c + d*v)^(m + n), x], x] /; FreeQ[{a, b, c, d, m, n}, x] && EqQ[b*c - a*d, 0] &&  !(IntegerQ[m] || IntegerQ[n
] || GtQ[b/d, 0])

Rule 29

Int[(x_)^(-1), x_Symbol] :> Simp[Log[x], x]

Rubi steps

\begin {align*} \int \frac {(-a-b x)^{-n} (a+b x)^n}{x} \, dx &=\left ((-a-b x)^{-n} (a+b x)^n\right ) \int \frac {1}{x} \, dx\\ &=(-a-b x)^{-n} (a+b x)^n \log (x)\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]
time = 0.00, size = 22, normalized size = 1.00 \begin {gather*} (-a-b x)^{-n} (a+b x)^n \log (x) \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[(a + b*x)^n/(x*(-a - b*x)^n),x]

[Out]

((a + b*x)^n*Log[x])/(-a - b*x)^n

________________________________________________________________________________________

Maple [C] Result contains higher order function than in optimal. Order 9 vs. order 3.
time = 0.08, size = 56, normalized size = 2.55

method result size
risch \(\ln \left (x \right ) \left (b x +a \right )^{n} {\mathrm e}^{-n \left (i \pi \mathrm {csgn}\left (i \left (b x +a \right )\right )^{3}-i \pi \mathrm {csgn}\left (i \left (b x +a \right )\right )^{2}+i \pi +\ln \left (b x +a \right )\right )}\) \(56\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((b*x+a)^n/x/((-b*x-a)^n),x,method=_RETURNVERBOSE)

[Out]

ln(x)*(b*x+a)^n*exp(-n*(I*Pi*csgn(I*(b*x+a))^3-I*Pi*csgn(I*(b*x+a))^2+I*Pi+ln(b*x+a)))

________________________________________________________________________________________

Maxima [A]
time = 0.30, size = 6, normalized size = 0.27 \begin {gather*} \left (-1\right )^{n} \log \left (x\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((b*x+a)^n/x/((-b*x-a)^n),x, algorithm="maxima")

[Out]

(-1)^n*log(x)

________________________________________________________________________________________

Fricas [A]
time = 1.58, size = 7, normalized size = 0.32 \begin {gather*} \cos \left (\pi n\right ) \log \left (x\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((b*x+a)^n/x/((-b*x-a)^n),x, algorithm="fricas")

[Out]

cos(pi*n)*log(x)

________________________________________________________________________________________

Sympy [C] Result contains complex when optimal does not.
time = 4.61, size = 44, normalized size = 2.00 \begin {gather*} \begin {cases} e^{- i \pi n} \log {\left (-1 + \frac {b \left (\frac {a}{b} + x\right )}{a} \right )} & \text {for}\: \left |{\frac {b \left (\frac {a}{b} + x\right )}{a}}\right | > 1 \\e^{- i \pi n} \log {\left (1 - \frac {b \left (\frac {a}{b} + x\right )}{a} \right )} & \text {otherwise} \end {cases} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((b*x+a)**n/x/((-b*x-a)**n),x)

[Out]

Piecewise((exp(-I*pi*n)*log(-1 + b*(a/b + x)/a), Abs(b*(a/b + x)/a) > 1), (exp(-I*pi*n)*log(1 - b*(a/b + x)/a)
, True))

________________________________________________________________________________________

Giac [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {could not integrate} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((b*x+a)^n/x/((-b*x-a)^n),x, algorithm="giac")

[Out]

integrate((b*x + a)^n/((-b*x - a)^n*x), x)

________________________________________________________________________________________

Mupad [F]
time = 0.00, size = -1, normalized size = -0.05 \begin {gather*} \int \frac {{\left (a+b\,x\right )}^n}{x\,{\left (-a-b\,x\right )}^n} \,d x \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((a + b*x)^n/(x*(- a - b*x)^n),x)

[Out]

int((a + b*x)^n/(x*(- a - b*x)^n), x)

________________________________________________________________________________________